﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ApprovedIncentives.aspx.cs"
    Inherits="RCREEE.Web.ApprovedIncentives" Culture="auto" meta:resourcekey="PageResource1"
    UICulture="auto" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Label ID="Label1" runat="server" Text="Select a Country : " meta:resourcekey="Label1Resource1"></asp:Label>
    <asp:DropDownList ID="CountryDDL" runat="server" AutoPostBack="True" DataSourceID="odsCountries"
        DataTextField="CountryName" DataValueField="CountryId" Width="50%">
    </asp:DropDownList>
    <br />
    <br />
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdateProgress ID="Up1" runat="Server" AssociatedUpdatePanelID="UpdatePanel2">
        <ProgressTemplate>
            <div class="progressBackgroundFilter">
            </div>
            <div class="processMessage">
                Loading...<br />
                <br />
                <img alt="Loading..." src="Images/Loading.gif" />
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                <ContentTemplate>
                    <asp:GridView ID="MasterGrid" runat="server" AutoGenerateColumns="False" CellPadding="4"
                        DataKeyNames="ItemId" DataSourceID="GetApproved" EnableModelValidation="True"
                        ForeColor="#333333" GridLines="None" meta:resourcekey="MasterGridResource1" OnSelectedIndexChanging="MasterGrid_SelectedIndexChanging"
                        Style="text-align: left" Width="100%" OnDataBound="MasterGrid_DataBound">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:CommandField meta:resourcekey="CommandFieldResource1" SelectText="Edit" ShowSelectButton="True" />
                            <asp:BoundField DataField="Name" HeaderText="Item" meta:resourcekey="BoundFieldResource1" />
                            <asp:BoundField DataField="Percentage" HeaderText="Percantage" meta:resourcekey="BoundFieldResource2" />
                            <asp:BoundField DataField="Ceiling" HeaderText="Ceiling" meta:resourcekey="BoundFieldResource3" />
                            <asp:BoundField DataField="ItemId" HeaderText="ItemId" meta:resourcekey="BoundFieldResource4"
                                Visible="False" />
                        </Columns>
                        <FooterStyle BackColor="#0268b0" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#0268b0" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#CCCCCC" ForeColor="#990000" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EAEAEA" ForeColor="#333333" />
                        <SelectedRowStyle BackColor="#CCCCCC" Font-Bold="True" ForeColor="#990000" />
                    </asp:GridView>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="CountryDDL" EventName="SelectedIndexChanged" />
                    <asp:AsyncPostBackTrigger ControlID="Save" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>
            <br />
            <br />
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <asp:FormView ID="FormView1" runat="server" DataSourceID="OneApproval" EnableModelValidation="True"
                        CellPadding="4" ForeColor="#333333" Width="363px" meta:resourcekey="FormView1Resource1">
                        <FooterStyle BackColor="#0268b0" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#0268b0" Font-Bold="True" ForeColor="White" />
                        <ItemTemplate>
                            <div>
                                <asp:Panel ID="Panel1" runat="server" GroupingText="Item" Width="337px" meta:resourcekey="Panel1Resource1">
                                    <table class="style1">
                                        <tr>
                                            <td>
                                                <asp:Label ID="Itemlb" runat="server" Text="Item" meta:resourcekey="ItemlbResource1"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:Label ID="Label2" runat="server" Text='<%# Bind("Name") %>' meta:resourcekey="Label2Resource1"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="Percentagel" runat="server" Text="Percentage" meta:resourcekey="PercentagelResource1"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="Percentagetb" runat="server" Text='<%# Bind("Percentage") %>' meta:resourcekey="PercentagetbResource1"></asp:TextBox>
                                                <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="Percentagetb"
                                                    ErrorMessage="Number " Operator="DataTypeCheck" Type="Integer">*</asp:CompareValidator>
                                            </td>
                                        </tr>
                                    </table>
                                </asp:Panel>
                            </div>
                            <div>
                                <asp:Panel ID="Panel2" runat="server" GroupingText="Ceiling" Width="283px" meta:resourcekey="Panel2Resource1">
                                    <table class="style1">
                                        <tr>
                                            <td>
                                                <asp:Label ID="Label3" runat="server" Text="EnglishCeiling" meta:resourcekey="Label3Resource1"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="Ceiling0" runat="server" Text='<%# Bind("EnglishCeiling") %>' meta:resourcekey="Ceiling0Resource1"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="Label4" runat="server" Text="ArabicCeiling" meta:resourcekey="Label4Resource1"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="Ceiling1" runat="server" Text='<%# BIND("ArabicCeiling") %>' meta:resourcekey="Ceiling1Resource1"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="Label5" runat="server" Text="FranceCeiling" meta:resourcekey="Label5Resource1"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="Ceiling2" runat="server" Text='<%# Bind("FranceCeiling") %>' meta:resourcekey="Ceiling2Resource1"></asp:TextBox>
                                            </td>
                                        </tr>
                                    </table>
                                </asp:Panel>
                            </div>
                            <asp:HiddenField ID="ApprovalId" runat="server" Value='<%# Bind("ApprovedIncentiveId") %>' />
                            <asp:HiddenField ID="ItemId" runat="server" Value='<%# Bind("ItemId") %>' />
                            <asp:HiddenField ID="Incentive" runat="server" Value='<%# Bind("IncentiveId") %>' />
                        </ItemTemplate>
                        <PagerStyle BackColor="#CCCCCC" ForeColor="#990000" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EAEAEA" ForeColor="#333333" />
                    </asp:FormView>
                    <table class="style1">
                        <tr>
                            <td class="style2">
                                <asp:LinkButton ID="Save" runat="server" CommandName="Update" OnClick="Save_Click"
                                    Text="Save" Visible="False" meta:resourcekey="SaveResource1"></asp:LinkButton>
                            </td>
                            <td>
                                <asp:LinkButton ID="Cancel" runat="server" OnClick="Cancel_Click1" Style="height: 14px;
                                    width: 82px" Visible="False" meta:resourcekey="CancelResource1">Cancel</asp:LinkButton>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </asp:UpdatePanel>
            <asp:ValidationSummary ID="ValidationSummary1" runat="server" />
            <asp:ObjectDataSource ID="GetCountries" runat="server" DataObjectTypeName="RCREEE.Library.Entities.Project"
                SelectMethod="GetCountries" TypeName="RCREEE.Library.Entities.Project" DeleteMethod="Deleteproject"
                InsertMethod="InsertProject" UpdateMethod="UpdateProject">
                <SelectParameters>
                    <asp:SessionParameter Name="LanguageCode" SessionField="LanguageCode" Type="Int32" />
                </SelectParameters>
            </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="OneApproval" runat="server" SelectMethod="GetOneApprovedIncentives"
                TypeName="RCREEE.Library.Entities.ApprovedIncentives">
                <SelectParameters>
                    <asp:ControlParameter ControlID="CountryDDL" Name="CountryId" PropertyName="SelectedValue"
                        Type="Int32" />
                    <asp:SessionParameter Name="LanguageCode" SessionField="LanguageCode" Type="Int32" />
                    <asp:ControlParameter ControlID="MasterGrid" Name="ItemId" PropertyName="SelectedValue"
                        Type="Int32" DefaultValue="0" />
                </SelectParameters>
            </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="GetApproved" runat="server" SelectMethod="GetApprovedIncentives"
                TypeName="RCREEE.Library.Entities.ApprovedIncentives">
                <SelectParameters>
                    <asp:ControlParameter ControlID="CountryDDL" Name="CountryId" PropertyName="SelectedValue"
                        Type="Int32" />
                    <asp:SessionParameter Name="LanguageCode" SessionField="LanguageCode" Type="Int32" />
                </SelectParameters>
            </asp:ObjectDataSource>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:ObjectDataSource ID="odsCountries" runat="server" SelectMethod="GetAllCountries"
        TypeName="RCREEE.Library.DataManager">
        <SelectParameters>
            <asp:SessionParameter Name="LanguageCode" SessionField="LanguageCode" Type="Int32" />
            <asp:Parameter DefaultValue="" Name="FirstItem" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
<asp:Content ID="Content3" runat="server" ContentPlaceHolderID="head">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 37px;
        }
    </style>
    <div id="header">
        <div id="section">
            <table width="100%">
                <tr>
                    <td width="25%" align="center" valign="middle">
                        <img src="Images/LogoRCREEE_Transparent.png" width="200px" />
                    </td>
                    <td width="50%" align="center">
                        <asp:Label ID="lbl_header_center" runat="server" Text="دليل إمكانيات الدول العربية<br/>في<br />مجالات الطاقة المتجددة و رفع كفاءة إنتاج و إستهلاك الطاقة"
                            Font-Bold="True" Font-Size="X-Large" Style="font-weight: bolder; color: #FFFFFF;
                            font-size: x-large; width: 100%; text-align: center;" meta:resourcekey="lbl_header_centerResource1">
                        </asp:Label>
                    </td>
                    <td width="25%" align="center" valign="middle">
                        <img src="Images/las-logo.png" width="100px" />
                    </td>
                </tr>
            </table>
        </div>
        <ul>
            <li><a href="Default.aspx">Home</a></li>
            <li><a href="Index.aspx">Index</a></li>
            <li><a href="Topics.aspx">Topics</a></li>
            <li><a href="CountrySelector.aspx">Countries</a></li>
            <li><a href="Aboutus.aspx">About Us</a></li>
            <li><a href="contactus.aspx">Contact us</a></li>
        </ul>
    </div>
</asp:Content>
